.flow-designer {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.flow-actions {
  display: flex;
  justify-content: space-between;
  height: 50px;
  padding: 0 20px;
  align-items: center;
}
.flow-editor-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
}
.flow-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 0px;
  margin-bottom: 40px;

  .flow-toolbar {
    height: 40px;
  }
}
.flow-meta-container {
  width: 400px;
  overflow: auto;

  .flow-meta-editor {
    margin-bottom: 20px;
  }

  .el-tabs__nav.is-top {
    float: none;
    .el-tabs__item {
      flex: auto;
    }
  }
  .el-tabs__header.is-top {
    margin: 0;
  }

  .trigger-header {
    margin-bottom: 8px;
  }

  .btn-add-trigger {
    color: #6a83fc;
    border: 0;
    padding-left: 0;
    background: #fff !important;
  }

  .show-triggers {
    display: flex;
    line-height: 30px;
    padding: 4px 4px 0px 4px;
    flex: 1;
    &:hover {
      background: rgba(5, 30, 80, 0.04);
    }
  }
  .btn-delete-trigger {
    color: #eb5050;
    border: 0;
    padding-left: 0;
    background: #fff !important;
    font-size: 12px;
    cursor: pointer;
    margin-right: 3px;
  }
}

.notAllow {
  color: #999 !important;
  cursor: not-allowed !important;
  &:hover {
    cursor: not-allowed;
    background: #fff;
  }
}
.data-triggers {
  width: 200px;

  .trigger-header {
    margin-bottom: 8px;
    .trigger-title {
      color: #141e31;
      font-size: 14px;
      font-weight: 700;
    }
    .trigger-desc {
      color: #838892;
      font-size: 14px;
      margin-top: 8px;
    }
    .itrigger-text {
      color: #141e31;
      font-size: 14px;
      margin-top: 8px;
    }
    .add-trigger {
      padding-left: 16px;
      line-height: 32px;
      &:hover {
        cursor: pointer;
        background: rgba(5, 30, 80, 0.04);
      }
    }
  }
}
.flow-diagram {
  background-color: #f5f6f8;
  padding: 10px;
  text-align: center;
  z-index: 0;
  font-size: 12px;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-content: center;
  align-items: flex-start;
  border-right: none;
  overflow: auto;
  padding-top: 20px;
  padding-bottom: 20px;
  flex: 1;

  .flow-node-wrapper {
    cursor: pointer;
    padding-bottom: 30px;
    width: 200px;
    min-height: 60px;
    position: relative;
    margin: 0 auto;
    z-index: 6;
    &:hover {
      .btn-add-node {
        color: #fff;
        box-shadow: 0 10px 20px 0 rgba(33, 43, 54, 0.1);
        opacity: 1;
      }
    }
    &:after {
      background: #bbb;
      width: 2px;
      position: absolute;
      left: 50%;
      margin-left: -1px;
      top: 0;
      bottom: 0;
      z-index: -1;
      content: "";
    }

    .flow-node {
      position: relative;
      width: 200px;
      height: auto;
      margin: 0 auto;
      box-sizing: border-box;
      font-size: 12px;
      border-radius: 8px;
      background-color: #fff;
      box-shadow: 0 6px 6px 0 rgba(33, 43, 54, 0.12);
      text-align: left;
      overflow: hidden;
      transform: translateY(0);
      transition: all 0.2s linear;

      &:hover {
        outline: 1px solid #6a83fc;
        transition: all 0.2s linear;
      }

      &.active {
        outline: 2px solid #6a83fc;
      }

      &.success {
        border: 1px solid #6bbf77;
      }

      &.error {
        border: 1px solid #eb5050;
      }

      .icon-branch-header {
        transform: rotate(-45deg) translateY(6px);
        opacity: 0.5;
        cursor: pointer;
      }

      .flow-node-title {
        position: relative;
        display: flex;
        align-items: center;
        height: 32px;
        font-size: 14px;
        font-weight: 600;
        color: #22262a;
        padding-right: 16px;
        padding-left: 11px;

        &.initiator {
          background: #f0f3ff;
          color: #222;
        }

        .node-icon {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 20px;
          height: 20px;
          min-width: 20px;
          min-height: 20px;
          border-radius: 4px;
          margin-right: 4px;
        }

        .node-title-text {
          font-size: 14px;
          font-weight: 600;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }

      .flow-node-content {
        padding: 0 11px;
        margin: 4px;

        .node-desc {
          font-size: 14px;
          line-height: 24px;
          box-sizing: border-box;
          padding: 4px 0;
        }
      }
    }

    .flow-connector {
      margin-top: 30px;
      width: 100%;
      height: 30px;
      background: transparent;
    }
  }

  .btn-add-node {
    position: absolute;
    bottom: 30px;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 22px;
    border-radius: 50%;
    background-color: #fff;
    left: 50%;
    color: #dde1e6;
    cursor: pointer;
    z-index: 9;
    box-shadow: 0 4px 4px 0 rgba(33, 43, 54, 0.12);
    font-size: 20px;
    transform: translateX(-50%);
    opacity: 0;

    .round-btn {
      transition: all 0.2s linear;
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;

      .add-icon {
        width: 12px;
        height: 12px;
        display: block;
        position: relative;

        &.gray {
          background: #fff;
        }

        &::before {
          display: block;
          content: "";
          background: #6a83fc;
          border-radius: 2px;
          position: absolute;
          width: 2px;
          height: 12px;
          top: 0px;
          left: 5px;
        }

        &::after {
          display: block;
          content: "";
          background: #6a83fc;
          border-radius: 2px;
          width: 12px;
          height: 2px;
          position: absolute;
          top: 5px;
          left: 0px;
        }
      }
    }
  }

  .flow-end-wrapper {
    position: relative;

    .flow-end-node {
      font-weight: 700;
      color: #fff;
      background-color: #111e30;
      position: relative;
      height: 50px;
      width: 50px;
      line-height: 50px;
      border-radius: 50%;
      font-size: 12px;
      text-align: center;
      margin: 0 auto;
      z-index: 7;
    }
  }

  .arrow-down {
    color: #bbb;
    position: absolute;
    top: -18px;
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    font-size: 24px;
  }
}
.bg-grid {
  background-image:
    linear-gradient(90deg, rgba(203, 213, 225, 0.2) 1px, transparent 0),
    linear-gradient(180deg, rgba(203, 213, 225, 0.2) 1px, transparent 0) !important;
  background-size: 20px 20px !important;
  background-position: 50% !important;
}
.node-action-popover {
  cursor: pointer;
  max-width: 60px;
  min-width: 60px !important;
}
.node-actions {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-around;
  width: 60px;
  height: 24px;

  .copy-btn {
    width: 50%;
    height: 100%;
    align-items: center;
    font-size: 14px;
    display: flex;
    justify-content: center;
  }
  .action-split {
    width: 1px;
    margin-top: 4px;
    margin-bottom: 4px;
    background-color: #b3b3b3;
    display: flex;
    justify-content: center;
  }
  .delete-btn {
    width: 50%;
    height: 100%;
    align-items: center;
    font-size: 14px;
    display: flex;
    justify-content: center;
  }
}

/***************分支*****************/

.branch-body {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  padding-bottom: 50px;
  margin: 0 auto;
  position: relative;
  padding-top: 9px;
  background: transparent !important;
  .branch-head {
    position: absolute;
    left: 50%;
    top: 10px;
    margin-left: -1px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    z-index: 9;
    font-size: 14px;
    -webkit-transform: translate(-11px, -12px) rotate(45deg);
    -ms-transform: translate(-11px, -12px) rotate(45deg);
    transform: translate(-11px, -12px) rotate(45deg);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    background: #6a83fc;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 3px 6px;

    &:hover {
      background: #6a83fc;
      box-shadow: rgba(0, 0, 0, 0.1) 0px 3px 6px;
    }

    .add-icon {
      transform: translate(0px, 0px) rotate(45deg);
      width: 12px;
      height: 12px;
      display: block;
      position: relative;

      &::after {
        display: block;
        content: "";
        background: #fff;
        border-radius: 2px;
        width: 12px;
        height: 2px;
        position: absolute;
        top: 5px;
        left: 0px;
      }

      &::before {
        display: block;
        content: "";
        background: #fff;
        border-radius: 2px;
        position: absolute;
        width: 2px;
        height: 12px;
        top: 0px;
        left: 5px;
      }
    }
  }

  .branch-list {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    padding-bottom: 50px;
    margin: 0 auto;
    background: transparent !important;

    .branch-item {
      padding: 0 24px;
      position: relative;
      -webkit-box-orient: vertical;
      -webkit-box-direction: normal;
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
      display: flex;

      &::before {
        border-top: 2px solid #bbb;
        top: 0;
        content: "";
        height: 30px;
        position: absolute;
        left: 0;
        right: 0;
      }
      &::after {
        border-bottom: 2px solid #bbb;
        bottom: 0;
        content: "";
        height: 30px;
        position: absolute;
        left: 0;
        right: 0;
      }

      &:first-child {
        &::before {
          margin-left: -1px;
          left: 50%;
        }
        &::after {
          margin-left: -1px;
          left: 50%;
        }
        .branch-line {
          top: 6px;
          bottom: 6px;
        }
        .flow-item::after {
          bottom: 0;
        }
        .branch-foot::after {
          bottom: 0;
        }
      }

      &:last-child {
        &::before {
          margin-right: -1px;
          right: 50%;
        }
        &::after {
          margin-right: -1px;
          right: 50%;
        }
        .branch-line {
          top: 6px;
          bottom: 6px;
        }
        .flow-item::after {
          bottom: 0;
        }
        .branch-foot::after {
          bottom: 0;
        }
      }

      .branch-item-panel {
        .branch-item-condition {
          width: 200px;
          position: relative;
          margin: 0 auto;
          min-height: 120px;
          padding-top: 30px;
        }
      }
    }

    .branch-line {
      width: 2px;
      background: #bbb;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      margin-left: -1px;
    }
  }

  .branch-foot {
    width: 200px;
    height: 100px;
    position: absolute;
    left: 50%;
    bottom: 0;
    margin-left: -100px;

    &:hover {
      .btn-add-node {
        color: #fff;
        box-shadow: 0 10px 20px 0 rgba(33, 43, 54, 0.1);
        opacity: 1;
      }
    }

    &::after {
      content: "";
      width: 2px;
      background: #bbb;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      margin-left: -1px;
    }
  }
}
